﻿using System;
using System.Collections.Generic;
using Me.Prettyprint.Cassandra.Serializers;
using Me.Prettyprint.Cassandra.Service;
using Me.Prettyprint.Hector.Api;
using Me.Prettyprint.Hector.Api.Beans;
using Me.Prettyprint.Hector.Api.Factory;
using Me.Prettyprint.Hector.Api.Query;
using Org.Apache.Cassandra.Thrift;

namespace Me.Prettyprint.Cassandra.Model.Thrift
{
    public class ThriftCountQuery<K, N> : AbstractThriftCountQuery<K, N>, CountQuery<K, N>
    {
        public ThriftCountQuery(Keyspace k, Serializer<K> keySerializer,
            Serializer<N> nameSerializer) : base(k, keySerializer, nameSerializer)
        {
        }
        public override QueryResult<int> Execute()
        {
            return base.CountColumns();
        }
        public override string ToString()
        {
            return "CountQuery(" + ColumnFamily + "," + Key + ")";
        }
        public new CountQuery<K, N> SetKey(K key)
        {
            return (CountQuery<K, N>) base.SetKey(key);
        }
        public new CountQuery<K, N> SetColumnFamily(string cf)
        {
            return (CountQuery<K, N>) base.SetColumnFamily(cf);
        }
        public new CountQuery<K, N> SetRange(N start, N finish, int count)
        {
            return (CountQuery<K, N>) base.SetRange(start, finish, count);
        }
        public new CountQuery<K, N> SetColumnNames(List<N> columnNames)
        {
            return (CountQuery<K, N>) base.SetColumnNames(columnNames);
        }
    }
}
